var readline = require('readline');  
var fs = require('fs');  
  
var fReadName = './css.css';  
// var fWriteName = './1.readline.log';  
// var fWrite = fs.createWriteStream(fWriteName);  
var fRead = fs.createReadStream(fReadName);  
  
  
var objReadline = readline.createInterface({  
    input: fRead
// 这是另一种复制方式，这样on('line')里就不必再调用fWrite.write(line)，当只是纯粹复制文件时推荐使用  
// 但文件末尾会多算一次index计数   sodino.com  
//  output: fWrite,   
//  terminal: true  
});  
  
  
// var index = 1;  
// var arr= [];
objReadline.on('line', (line)=>{  
    var tmp;
    try {
        tmp = line.match(/\.(.*)?:before/)[1];
        console.log('<i class="kuma-icon '+ tmp + '">' + tmp + '</i>');
    } catch(err)  {

    } 

    // fWrite.write(tmp + os.EOL); // 下一行  
    // console.log(index, line);  
    // index ++;  
});  
  
objReadline.on('close', ()=>{  
    // console.log(arr);
    console.log('readline close...');  
});  
  